<?php

namespace app\admin\validate\statistics;

use think\Validate;

class Orderdetail extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'order_id' => 'require|number|unique:order_detail,order_id^trademark_printing^colour_id',
        'trademark_printing' => 'require|unique:order_detail,order_id^trademark_printing^colour_id',
        'colour_id' => 'require|number|unique:order_detail,order_id^trademark_printing^colour_id',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'order_id.unique' => '当前订单下已经存在相同商标印字和色号的商品！',
        'trademark_printing.unique' => '当前订单下已经存在相同商标印字和色号的商品！',
        'colour_id.unique' => '当前订单下已经存在相同商标印字和色号的商品！',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['order_id','trademark_printing','colour_id'],
        'edit' => [],
    ];
    
}
